package com.gitee.swsk33.mapstructdemo.dataobject;

import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.RelationManyToMany;
import com.mybatisflex.annotation.Table;
import lombok.Data;

import java.util.List;

/**
 * 故事
 */
@Data
@Table("story")
public class StoryDO {

	/**
	 * 主键id
	 */
	@Id(keyType = KeyType.Auto)
	private Integer id;

	/**
	 * 故事名称
	 */
	private String name;

	/**
	 * 故事涉及到的角色
	 */
	@RelationManyToMany(joinTable = "story_figure",
			selfField = "id", joinSelfColumn = "story_id",
			targetField = "id", joinTargetColumn = "figure_id")
	private List<FigureDO> figures;

}